All Functions Used So Far, Week 3

geom_point

{GGPLOT2}

Generates a scatter plot

is.na

{base}

Check if a value is NA/elements of vector are NA

prop.test

{stats}

Test of Equal or Given Proportions

theme

{GGPLOT2}

Set theme for GGPLOT2

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

median

{stats}

Get median of a vector

ggsave

{ggplot2}

Saves the last ggplot or a specified ggplot object to a file

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

summary

{base}

Obtain summary statistics or detailed regression output

round

{base}

Rounds numbers

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

element_text

{GGPLOT2}

Customise text in GGPLOT2

rename

{dplyr}

Renames columns in a data frame or tibble.

ordered

{dplyr}

Create an ordered factor

mean

{base}

Get mean of a vector

t.test

{stats}

Performs one and two sample t-tests on vectors of data.

geom_smooth

{GGPLOT2}

Generates a smoothed conditional means curve / line

chisq.test

{stats}

Chi-Squared test (e.g. for cross-tabulations)

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

min

{base}

Get minimum of a vector

leveneTest

{car}

Computes Levene’s test for homogeneity of variance across groups.

ungroup

{dplyr}

Resolve grouping created with “group_by”

read_excel

{readxl}

Read an Excel file

c

{base}

Combine values/vectors into a vector

setwd

{base}

Set Working Directory

slice_sample

{dplyr}

Randomly selects rows from a data frame or tibble.

cut

{base}

Convert Numeric to Factor

set.seed

{base}

Initialise a pseudorandom number generator.

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

mutate

{dplyr}

Modify/create a column in a data frame

element_line

{GGPLOT2}

Customise line appearance

library

{base}

Load an R package

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

with

{base}

evaluate expression in the context of a data frame

filter

{dplyr}

Filter out rows of a data frame according to logical vector

nrow

{base}

Get number of rows of a data frame

select

{dplyr}

Select columns from a tibble/data frame

ggplot

{GGPLOT2}

Create a ggplot graph

The end!